package main.collection;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.junit.Test;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @author chenggm
 * @create 2017-02-23 15:26
 **/
public class NumSort {
	@Test
	public void test() throws Exception {
		List<String> result  = new LinkedList<String>();
		result.add("1");
		result.add("2");
		result.add("3");
		result.add("4");
		Gson gson = new Gson();
		System.out.println(gson.toJson(result));
	}

	@Test
	public void test2() throws Exception {
		List<String> result  = new ArrayList<String>();
		result.add("1");
		result.add("2");
		result.add("3");
		result.add("4");
		Gson gson = new Gson();
		System.out.println(gson.toJson(result));
	}

	@Test public void test3() throws Exception {
		String str = String.valueOf(System.currentTimeMillis());
		System.out.println(str);
		System.out.println(str.length());
		System.out.println(str.substring(str.length()-12,str.length()-1));
	}

	@Test public void test4() throws Exception {
		String str = 10*Math.random()+"";
		System.out.println(str);
	}

	@Test public void test5() throws Exception {
		String code = "0012253658962156";
		for (int i = 0;i<code.length()/4;i++) {
			String tempCode = code.substring(0, code.length() - 4 * (i + 1));
			System.out.println(tempCode);
		}
	}

}
